#include <cstdio>

int main( )
{
    long long n, i;
    int ans, t, p;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%I64d", &n); n++;
        ans = 1;
        for ( i = 2; i * i <= n; i++ )
        {
            p = 0;
            while ( n % i == 0 )
            {
                p++;
                n /= i;
            }
            ans *= p + 1;
        }
        if ( n > 1 )
            ans *= 2;
        ans -= 2;
        ans = ( ans + 1 ) / 2;
        printf("%d\n", ans);
    }
    return 0;
}
